package edu.gatech.volt2.drdoommgt.gui;

import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.event.ActionListener;

import javax.swing.ButtonGroup;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.border.EmptyBorder;

@SuppressWarnings("serial")
public class UserInformationWindow extends JFrame implements IUserInfoView{

	private JPanel contentPane;
	private JTextField middleNameField;
	private JTextField firstNameField;
	private JTextField lastNameField;
	private JTextField emailField;
	private JButton cancelButton;
	private JButton saveButton;
	private ButtonGroup group;


	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					UserInformationWindow frame = new UserInformationWindow();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public UserInformationWindow() {
		setTitle("Dr. Doom Management");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 457, 226);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JLabel lblUserInformation = new JLabel("User Information");
		lblUserInformation.setBounds(5, 5, 431, 14);
		lblUserInformation.setHorizontalAlignment(SwingConstants.CENTER);
		contentPane.add(lblUserInformation);
		
		JPanel infoPanel = new JPanel();
		infoPanel.setBounds(5, 19, 431, 127);
		contentPane.add(infoPanel);
		infoPanel.setLayout(null);
		
		JLabel lblFirstNam = new JLabel("First Name");
		lblFirstNam.setBounds(6, 9, 91, 14);
		infoPanel.add(lblFirstNam);
		
		firstNameField = new JTextField();
		firstNameField.setBounds(109, 6, 322, 20);
		infoPanel.add(firstNameField);
		
		JLabel lblMiddleName = new JLabel("Middle Name");
		lblMiddleName.setBounds(6, 35, 91, 14);
		infoPanel.add(lblMiddleName);
		
		middleNameField = new JTextField();
		middleNameField.setBounds(109, 32, 322, 20);
		infoPanel.add(middleNameField);
		middleNameField.setColumns(10);
		
		JLabel lblLastName = new JLabel("Last Name");
		lblLastName.setBounds(6, 61, 91, 14);
		infoPanel.add(lblLastName);
		
		lastNameField = new JTextField();
		lastNameField.setBounds(109, 58, 322, 20);
		infoPanel.add(lastNameField);
		lastNameField.setColumns(10);
		
		JLabel lblEmail = new JLabel("Email");
		lblEmail.setBounds(6, 87, 60, 14);
		infoPanel.add(lblEmail);
		
		emailField = new JTextField();
		emailField.setBounds(109, 84, 322, 20);
		infoPanel.add(emailField);
		emailField.setColumns(10);
		
		JPanel actionButtons = new JPanel();
		actionButtons.setBounds(5, 158, 446, 40);
		contentPane.add(actionButtons);
		actionButtons.setLayout(null);
		
		cancelButton = new JButton("Cancel");
		cancelButton.setBounds(0, 15, 93, 23);
		actionButtons.add(cancelButton);
		
		saveButton = new JButton("Save");
		saveButton.setBounds(371, 15, 75, 23);
		actionButtons.add(saveButton);
		
		
		group = new ButtonGroup();
		
		
	}

	/**
	 * @return the firstNameField
	 */
	public JTextField getFirstNameField() {
		return firstNameField;
	}
	
	/**
	 * @return the middleNameField
	 */
	public JTextField getMiddleNameField() {
		return middleNameField;
	}



	/**
	 * @return the zipCodeField
	 */
	public JTextField getZipCodeField() {
		return null;
	}

	/**
	 * @return the lastNameField
	 */
	public JTextField getLastNameField() {
		return lastNameField;
	}

	/**
	 * @return the emailField
	 */
	public JTextField getEmailField() {
		return emailField;
	}

	/**
	 * @return the homePhone
	 */
	public JTextField getPhone() {
		return null;
	}


	/**
	 * @return the addressField
	 */
	public JTextField getAddressField() {
		return null;
	}

	/**
	 * @return the cityField
	 */
	public JTextField getCityField() {
		return null;
	}

	/**
	 * @return the rdbtnMale
	 */
	public JRadioButton getRdbtnMale() {
		return null;
	}

	/**
	 * @return the rdbtnFemale
	 */
	public JRadioButton getRdbtnFemale() {
		return null;
	}

	/**
	 * @return the monthBox
	 */
	public JComboBox getMonthBox() {
		return null;
	}

	/**
	 * @return the dayBox
	 */
	public JComboBox getDayBox() {
		return null;
	}

	/**
	 * @return the yearBox
	 */
	public JComboBox getYearBox() {
		return null;
	}

	/**
	 * @return the stateComboBox
	 */
	public JComboBox getStateComboBox() {
		return null;
	}

	/**
	 * @return the cancelButton
	 */
	public JButton getCancelButton() {
		return cancelButton;
	}

	/**
	 * @return the saveButton
	 */
	public JButton getSaveButton() {
		return saveButton;
	}
	
	/**
	 * @return the group
	 */
	public ButtonGroup getGroup() {
		return group;
	}

	@Override
	public void showSelf() {
		this.setVisible(true);
		
	}

	@Override
	public void addListener(ActionListener al) {
		
		middleNameField.addActionListener(al);
		firstNameField.addActionListener(al);
		lastNameField.addActionListener(al);
		emailField.addActionListener(al);

		cancelButton.addActionListener(al);
		saveButton.addActionListener(al);
		
	}

	@Override
	public void hideSelf() {
		this.setVisible(false);
	}
}
